package com.eshipenet.shipnet.edgeboxextbuilder
import org.apache.flink.streaming.api.scala._
import play.api.libs.json.{JsObject, Json}

object EdgeBoxActionJsonStreamProvider {

  def edgeBoxActionJsonStream(env: StreamExecutionEnvironment): DataStream[JsObject] = {
    env.fromCollection(
      List(
        Json.obj(
          "schema" -> Json.obj(),
          "payload" -> Json.obj(
            "ts_ms" -> 1,
            "op"    -> "i",
            "after" -> Json.obj(
              "id"        -> "1",
              "name"      -> "n1",
              "modelId"   -> "1",
              "createdAt" -> 1,
              "updatedAt" -> 1,
            ),
          )
        ),
        Json.obj(
          "schema" -> Json.obj(),
          "payload" -> Json.obj(
            "ts_ms" -> 1,
            "op"    -> "i",
            "after" -> Json.obj(
              "id"        -> "2",
              "name"      -> "n1",
              "modelId"   -> "1",
              "createdAt" -> 1,
              "updatedAt" -> 2,
            ),
          )
        ),
      ))
  }

}
